//
//  UserDownloadTableViewCell.m
//  XinKaiFa55like
//
//  Created by junseek on 2017/3/26.
//  Copyright © 2017年 55like lj. All rights reserved.
//

#import "UserDownloadTableViewCell.h"

@interface UserDownloadTableViewCell (){    //
    
    NSIndexPath *tempIndexPath;
    NSDictionary *tempDic;
    
    
    
    UIImageView *imageLogo;
    UILabel *lblTitle;
    UILabel *lblContent;
    UILabel *lblDate;
    
    
}
@end
@implementation UserDownloadTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        
        
        imageLogo=[RHMethods imageviewWithFrame:CGRectMake(10, 10, 60, 60) defaultimage:@"pdficon"];
        [self addSubview:imageLogo];
        
        lblTitle=[RHMethods labelWithFrame:CGRectMake(80, 10, kScreenWidth-140, 20) font:fontTitle color:rgbTitleColor text:@""];
        [self addSubview:lblTitle];
        
        lblContent=[RHMethods labelWithFrame:CGRectMake(80, 30, kScreenWidth-140, 28) font:fontSmallTitle color:rgbTxtGray text:@""];
        [self addSubview:lblContent];
        
        lblDate=[RHMethods labelWithFrame:CGRectMake(80, YH(lblContent), W(lblContent), 14) font:fontSmallTitle color:rgbTxtGray text:@""];
        [self addSubview:lblDate];
        
        UIButton *btnDownload=[RHMethods buttonWithFrame:CGRectMake(kScreenWidth-56, 28, 46, 24) title:@"下载" image:nil bgimage:@"downIcon"];
        btnDownload.titleLabel.font=fontTxtContent;
        [btnDownload setTitleColor:rgbpublicColor forState:UIControlStateNormal];
        [btnDownload setUserInteractionEnabled:NO];
        [self addSubview:btnDownload];
        [self addSubview:[RHMethods lineViewWithFrame:CGRectMake(0, 79.5, kScreenWidth, 0.5)]];
        
    }
    return self;
}

//内容更新
-(void)setValueForDictionary:(NSDictionary *)dic indexPath:(NSIndexPath *)indexPath type:(NSString *)strType{
    tempIndexPath=indexPath;
    tempDic=dic;
    
    [imageLogo imageWithURL:[dic valueForJSONStrKey:@"path"] useProgress:NO useActivity:NO];
    lblTitle.text=[dic valueForJSONStrKey:@"name"];
    lblContent.text=[dic valueForJSONStrKey:@"desc"];
    lblDate.text=[dic valueForJSONStrKey:@"ctime"];
    //80
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
